<template>
  <div class="right">
      <breadcrumb></breadcrumb>
      <!-- 权限管理卡片 -->
      <el-card>
        <!-- 权限表单制作 -->
        <el-table :data="RightList" style="width: 100%" border stripe>
           <el-table-column  type="index" >
          </el-table-column>
         <el-table-column prop="authName" label="权限名称" >
         </el-table-column>
         <el-table-column prop="path" label="路径" >
         </el-table-column>
         <el-table-column prop="level" label="权限等级">
           <template slot-scope="scope">
             <el-tag v-if="scope.row.level == 0" size="mini">标签一</el-tag>
             <el-tag type="success" v-else-if="scope.row.level == 1" size="mini">标签二</el-tag>
             <el-tag type="warning" v-else size="mini">标签三</el-tag>
           </template>
        </el-table-column>
         </el-table>
      </el-card>
  </div>
</template>


<script>

import breadcrumb from "../../component/content/breadcrumb.vue"
import {netrequest} from "../../network/request.js"

export default {
  name:'right',
  data(){
    return{
      RightList:null
    }
  },
  components:{
    breadcrumb
  },
  methods:{
    // 获取权限管理数据
    async GetRightsList(){
      // 向服务器请求权限管理的数据
      const {data:res} = await netrequest({method:'get',url:'/rights/list'})
      // 请求得到的数组保存起来，方便以后使用
      this.RightList = res.data
      console.log(this.RightList);
    }
  },
  created(){
    // 获取权限管理数据
    this.GetRightsList()
  }
}
</script>

<style scoped>

</style>